<html><head><title>Math.pb</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font><font color="#006666">;   PureBasic - Math example file
</font><font color="#006666">;
</font><font color="#006666">;    (c) Fantaisie Software
</font><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font>

<b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 200, 200, 400, 400, "Test")

<font color="#006666">  ImageGadget</font>(0, 0, 0, 400, 400, 0)

<font color="#006666">  CreateImage</font>(0, 400, 400)

  X.f = 40+<font color="#006666">Random</font>(40)
  Y.f = X
  
<font color="#006666">  AddWindowTimer</font>(0, 0, 10)
  
  <b><font color="#006666">Repeat</font></b>
    Event =<font color="#006666"> WaitWindowEvent</font>()
    
    <b><font color="#006666">If</font></b> Event = <font color="#924B72">#PB_Event_Timer</font>
      a.f+0.01
    
      <b><font color="#006666">If</font></b> <font color="#006666">StartDrawing</font>(<font color="#006666">ImageOutput</font>(0))
<font color="#006666">        FrontColor</font>(<font color="#006666">RGB</font>(0,<font color="#006666"> Random</font>(255),<font color="#006666"> Random</font>(255)))
        
        x2.f = X*<font color="#006666">Cos</font>(a) + Y*<font color="#006666">Sin</font>(a)
        y2.f = X*<font color="#006666">Sin</font>(a) - Y*<font color="#006666">Cos</font>(a)
        
<font color="#006666">        Plot</font>(200+x2, 200+y2)
<font color="#006666">        Plot</font>(100+x2, 200+y2)
  
<font color="#006666">        StopDrawing</font>()
      <b><font color="#006666">EndIf</font></b>
  
<font color="#006666">      SetGadgetState</font>(0,<font color="#006666"> ImageID</font>(0))
    <b><font color="#006666">EndIf</font></b>
    
  <b><font color="#006666">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  
<b><font color="#006666">EndIf</font></b></font></pre>
</body></html>
